<template>
  <div class="add-content active" @click="showButton = true">
    <wd-icon name="add1" size="50rpx" color="#fff"></wd-icon>
  </div>

  <div
    class="mask"
    :style="{
      bottom: showButton ? '0vh' : '-100vh',
    }"
  >
    <div class="content">
      <div class="item active" @click="goPage('/pages-sub/artist/add-activity')">
        <div class="img">
          <image src="./images/activity.png" />
        </div>
        <div class="name">发布活动</div>
      </div>
      <div class="item active" @click="goPage('/pages-sub/artist/add-trends')">
        <div class="img">
          <image src="./images/dt.png" />
        </div>
        <div class="name">发布动态</div>
      </div>
    </div>
    <div class="close" @click="showButton = false">
      <wd-icon name="close" size="23px" color="#8A8F99"></wd-icon>
    </div>
  </div>
</template>
<script setup lang="ts">
import { to } from '@/utils/page'

defineOptions({ name: 'AddContentButton' })

const showButton = ref(false)

function goPage(path) {
  showButton.value = false
  to(path)
}
</script>
<style lang="scss" scoped>
.add-content {
  position: fixed;
  right: 70rpx;
  bottom: 70rpx;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112rpx;
  height: 112rpx;
  background-color: var(--color1);
  border-radius: 50%;
  box-shadow: 0px 17.31px 28.85px rgba(31, 32, 38, 0.3);
}
.mask {
  position: fixed;
  bottom: 100vh;
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100vw;
  height: 100vh;
  background: rgba(223, 227, 230, 0.6);
  backdrop-filter: blur(5px);
  transition: bottom 0.2s;
  .close {
    margin-bottom: 80rpx;
  }
  .content {
    display: flex;
    justify-content: space-between;
    width: 446rpx;
    margin-bottom: 160rpx;
    .item {
      text-align: center;
      .img {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 120rpx;
        height: 120rpx;
        background-color: #fff;
        border-radius: 50%;
        image {
          width: 70rpx;
          height: 70rpx;
        }
      }
      .name {
        margin-top: 12rpx;
        font-size: 27rpx;
        color: var(--color2);
      }
    }
  }
}
</style>
